home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Image Codec.h
- Contains: Image Compressor/Decompressor definitions
- Copyright: © 1991 by Apple Computer, Inc., all rights reserved.
- */
-
-
- #ifndef __CODECGUTS__
-
- #define __CODECGUTS__
-
- #include <Types.h>
- #include <Memory.h>
- #include <SysEqu.h>
- #include <QuickDraw.h>
- #include <Errors.h>
- #include <QDOffscreen.h>
-
- #include "Image Compression.h"
-
- #ifdef CODEC_MGR_VERSION
- #if CODEC_MGR_VERSION != 15
- WRONG CODEC_MGR_VERSION
- #endif
- #endif
-
-
-
- /* codec component selectors */
-
- #define codecGetCodecInfo 0x00
- #define codecGetCompressionTime 0x01
- #define codecGetMaxCompressionSize 0x02
- #define codecPreCompress 0x03
- #define codecBandCompress 0x04
- #define codecPreDecompress 0x05
- #define codecBandDecompress 0x06
- #define codecCDSequenceBusy 0x07
- #define codecGetCompressedImageSize 0x08
- #define codecGetSimilarity 0x09
- #define codecTrimImage 0x0a
-
- /* codec selectors 0-127 are reserved by Apple */
- /* codec selectors 128-191 are subtype specific */
- /* codec selectors 192-255 are vendor specific */
- /* codec selectors 256-32767 are available for general use */
- /* negative selectors are reserved by the Component Manager */
-
-
-
- /* codec capabilities flags */
-
- #define codecCanScale (1L<<0)
- #define codecCanMask (1L<<1)
- #define codecCanMatte (1L<<2)
- #define codecCanTransform (1L<<3)
- #define codecCanTransferMode (1L<<4)
- #define codecCanCopyPrev (1L<<5)
- #define codecCanSpool (1L<<6)
- #define codecCanClipVertical (1L<<7)
- #define codecCanClipRectangular (1L<<8)
- #define codecCanRemapColor (1L<<9)
- #define codecCanFastDither (1L<<10)
- #define codecCanSrcExtract (1L<<11)
- #define codecCanCopyPrevComp (1L<<12)
- #define codecCanAsync (1L<<13)
- #define codecCanMakeMask (1L<<14)
- #define codecCanShift (1L<<15)
-
-
- typedef struct {
- long flags;
- short wantedPixelSize;
- short extendWidth;
- short extendHeight;
- short bandMin;
- short bandInc;
- short pad;
- unsigned long time;
- } CodecCapabilities;
-
-
-
- /* codec condition flags */
-
- #define codecConditionFirstBand (1L<<0)
- #define codecConditionLastBand (1L<<1)
- #define codecConditionCodecChangedMask (1L<<31)
-
-
- #define codecInfoResourceType 'cdci' /* codec info resource type */
-
-
- typedef struct {
- ImageSequence sequenceID; /* precompress,bandcompress */
- ImageDescriptionHandle imageDescription; /* precompress,bandcompress */
- Ptr data;
- long bufferSize;
- long frameNumber;
- long startLine;
- long stopLine;
- long conditionFlags;
- CodecFlags callerFlags;
- CodecCapabilities *capabilities; /* precompress,bandcompress */
- ProgressProcRecord progressProcRecord;
- CompletionProcRecord completionProcRecord;
- FlushProcRecord flushProcRecord;
-
- PixMap srcPixMap; /* precompress,bandcompress */
- PixMap prevPixMap;
- CodecQ spatialQuality;
- CodecQ temporalQuality;
- Fixed similarity;
- long reserved[2];
- } CodecCompressParams;
-
-
- typedef struct {
- ImageSequence sequenceID; /* predecompress,banddecompress */
- ImageDescriptionHandle imageDescription; /* predecompress,banddecompress */
- Ptr data;
- long bufferSize;
- long frameNumber;
- long startLine;
- long stopLine;
- long conditionFlags;
- CodecFlags callerFlags;
- CodecCapabilities *capabilities; /* predecompress,banddecompress */
- ProgressProcRecord progressProcRecord;
- CompletionProcRecord completionProcRecord;
- DataProcRecord dataProcRecord;
-
- CGrafPtr port; /* predecompress,banddecompress */
- PixMap dstPixMap; /* predecompress,banddecompress */
- BitMapPtr maskBits;
- PixMapPtr mattePixMap;
- Rect srcRect; /* predecompress,banddecompress */
- MatrixRecord *matrix; /* predecompress,banddecompress */
- CodecQ accuracy; /* predecompress,banddecompress */
- short transferMode; /* predecompress,banddecompress */
- long reserved[2];
- } CodecDecompressParams;
-
-
-
- #ifdef __CALLING_CODECS__
- #define PREAMBLE ComponentInstance ti
- #else
- #define PREAMBLE Handle storage
- #endif
-
- pascal ComponentResult
- CDGetCodecInfo(PREAMBLE,CodecInfo *info)
- #ifdef __CALLING_CODECS__
- = {0x2f3c,4,codecGetCodecInfo,0x7000,0xa82a};
- #else
- ;
- #endif
-
- pascal ComponentResult
- CDGetCompressionTime(PREAMBLE,PixMapHandle src,Rect *srcRect, short depth,CodecQ *spatialQuality,
- CodecQ *temporalQuality,unsigned long *time)
- #ifdef __CALLING_CODECS__
- = {0x2f3c,22,codecGetCompressionTime,0x7000,0xa82a};
- #else
- ;
- #endif
-
- pascal ComponentResult
- CDGetMaxCompressionSize(PREAMBLE,PixMapHandle src,Rect *srcRect, short depth,CodecQ quality,long *size)
- #ifdef __CALLING_CODECS__
- = {0x2f3c,18,codecGetMaxCompressionSize,0x7000,0xa82a};
- #else
- ;
- #endif
-
-
- pascal ComponentResult
- CDPreCompress(PREAMBLE,CodecCompressParams *params)
- #ifdef __CALLING_CODECS__
- = {0x2f3c,4,codecPreCompress,0x7000,0xa82a};
- #else
- ;
- #endif
-
- pascal ComponentResult
- CDBandCompress(PREAMBLE,CodecCompressParams *params)
- #ifdef __CALLING_CODECS__
- = {0x2f3c,4,codecBandCompress,0x7000,0xa82a};
- #else
- ;
- #endif
-
- pascal ComponentResult
- CDPreDecompress(PREAMBLE,CodecDecompressParams *params)
- #ifdef __CALLING_CODECS__
- = {0x2f3c,4,codecPreDecompress,0x7000,0xa82a};
- #else
- ;
- #endif
-
- pascal ComponentResult
- CDBandDecompress(PREAMBLE,CodecDecompressParams *params)
- #ifdef __CALLING_CODECS__
- = {0x2f3c,4,codecBandDecompress,0x7000,0xa82a};
- #else
- ;
- #endif
-
- pascal ComponentResult
- CDCodecBusy(PREAMBLE,ImageSequence seq)
- #ifdef __CALLING_CODECS__
- = {0x2f3c,4,codecCDSequenceBusy,0x7000,0xa82a};
- #else
- ;
- #endif
-
-
- pascal ComponentResult
- CDGetCompressedImageSize(PREAMBLE,ImageDescriptionHandle desc,Ptr data,long bufferSize,
- DataProcRecordPtr dataProc,long *dataSize)
- #ifdef __CALLING_CODECS__
- = {0x2f3c,20,codecGetCompressedImageSize,0x7000,0xa82a};
- #else
- ;
- #endif
-
- pascal ComponentResult
- CDGetSimilarity(PREAMBLE,PixMapHandle src,Rect *srcRect,ImageDescriptionHandle desc,Ptr data,Fixed *similarity)
- #ifdef __CALLING_CODECS__
- = {0x2f3c,20,codecGetSimilarity,0x7000,0xa82a};
- #else
- ;
- #endif
-
- pascal ComponentResult
- CDTrimImage(PREAMBLE,ImageDescriptionHandle Desc,Ptr inData,long inBufferSize, DataProcRecordPtr dataProc,
- Ptr outData,long outBufferSize,FlushProcRecordPtr flushProc,Rect *trimRect,ProgressProcRecordPtr progressProc)
- #ifdef __CALLING_CODECS__
- = {0x2f3c,36,codecTrimImage,0x7000,0xa82a};
- #else
- ;
- #endif
-
-
- #endif __CODECGUTS__
-